#pragma once
#include "Xps/Util/XComsdef.h"
#include "IObjectFactory.h"

namespace Xps
{
    class ObjectFactory :
        public IObjectFactory
    {
    public:

        static const IObjectFactory * getInstance();

        virtual const IObject::Ptr FromBytes(const byte *_Src, const long &_Size) const;

        virtual long ToBytes( const IObject::Ptr _Object, byte *_Dst, const long &_MaxSize ) const;

        virtual const IObject::Ptr ConstructObject(const ObjectType &_Type, boost::archive::binary_iarchive &ia) const;

    protected:
        ObjectFactory(void);
        virtual ~ObjectFactory(void);
    };
};
